//
//  ZYCTestCell.m
//  ZDSC
//
//  Created by ZDTX on 2021/8/5.
//

#import "ZYCTestCell.h"
#import "ZYCCommonBaseModel.h"




@interface ZYCTestCell ()

@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *line;
@end
@implementation ZYCTestCell

- (void)setIsSelect:(BOOL)isSelect{
    _isSelect = isSelect;
    if (_isSelect) {
        _titleLabel.textColor = HEX_RGB(@"#009B4C");
    }else{
        _titleLabel.textColor = HEX_RGB(@"#2B302D");
    }
}

- (void)setModel:(ZYCCommonBaseModel *)model{
    _model = model;
    _titleLabel.text = model.name;
}



- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self.contentView addSubview:self.titleLabel];
        [self.contentView addSubview:self.line];
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).offset(20.0f);
            make.centerY.equalTo(self.contentView);
        }];
        [self.line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.bottom.equalTo(self.contentView);
            make.height.mas_equalTo(1.0f);
        }];
        
    }
    return self;
}


- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.font = [UIFont systemFontOfSize:14];
    }
    return _titleLabel;
}

- (UILabel *)line {
    if (!_line) {
        _line = [[UILabel alloc] init];
        _line.backgroundColor  = HEX_RGB(@"#EAEAEA");
    }
    return _line;
}
@end
